package StudySpringBoot5.controller;

import StudySpringBoot5.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SwaggerController {
    @RequestMapping(value = "/hello")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/getUser")
    public User getUser() {
        return new User();
    }

    @ApiOperation("狂神的接口")
    @PostMapping("/kuang")
    @ResponseBody
    public String kuang(@ApiParam("这个名字会被返回") String username) {
        return username;
    }
}